import os
# path = "F:\python\\2018-7"
path = "E:\python\daily_pratice\\2018-7"
# path = os.getcwd()


class file_option:
    def __init__(self,path):
        self.path = path
        self.dir = []
        self.file = []
        pass

    # def weather_file(self,path):
    #     for fn in os.listdir(path):
    #         type = os.path.isfile(path + '/' + fn)
    #         print(fn)
    #         if type == True:
    #             pass
    #         else:
    #             weather_file(self,path + '/' + fn)
    def class_file(self):
        g = os.walk(self.path)
        for path, d, filelist in g:
            print('path',path)
            print('d',d)
            if d ==[]:
                self.dir.append(d)
                # print(self.dir)
                for filename in filelist:
                    self.file.append(filename)
                    # print(os.path.join(path, filename))
        print('file_list',self.file)
        print('dir:',self.dir)

fo = file_option(path)
fo.class_file()







# g = os.walk("F:\python\\2018-7")
#
# for path, d, filelist in g:
#     print(d)
#     for filename in filelist:
#         print(os.path.join(path, filename))






